<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    220. Contains Duplicate III
   </h1>
   <p>
    Given an array of integers, find out whether there are two distinct indices
    <i>
     i
    </i>
    and
    <i>
     j
    </i>
    in the array such that the
    <b>
     absolute
    </b>
    difference between
    <b>
     nums[i]
    </b>
    and
    <b>
     nums[j]
    </b>
    is at most
    <i>
     t
    </i>
    and the
    <b>
     absolute
    </b>
    difference between
    <i>
     i
    </i>
    and
    <i>
     j
    </i>
    is at most
    <i>
     k
    </i>
    .
   </p>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong>nums = <span id="example-input-1-1">[1,2,3,1]</span>, k = <span id="example-input-1-2">3</span>, t = <span id="example-input-1-3">0</span>
<strong>Output: </strong><span id="example-output-1">true</span>
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong>nums = <span id="example-input-2-1">[1,0,1,1]</span>, k = <span id="example-input-2-2">1</span>, t = <span id="example-input-2-3">2</span>
<strong>Output: </strong><span id="example-output-2">true</span>
</pre>
     <div>
      <p>
       <strong>
        Example 3:
       </strong>
      </p>
      <pre>
<strong>Input: </strong>nums = <span id="example-input-3-1">[1,5,9,1,5,9]</span>, k = <span id="example-input-3-2">2</span>, t = <span id="example-input-3-3">3</span>
<strong>Output: </strong><span id="example-output-3">false</span>
</pre>
     </div>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    220. 存在重复元素 III
   </h1>
   <p>
    给定一个整数数组，判断数组中是否有两个不同的索引
    <em>
     i
    </em>
    和
    <em>
     j
    </em>
    ，使得&nbsp;
    <strong>
     nums [i]
    </strong>
    和&nbsp;
    <strong>
     nums [j]
    </strong>
    &nbsp;的差的绝对值最大为
    <em>
     t
    </em>
    ，并且
    <em>
     i
    </em>
    和
    <em>
     j
    </em>
    之间的差的绝对值最大为
    <em>
     ķ
    </em>
    。
   </p>
   <p>
    <strong>
     示例&nbsp;1:
    </strong>
   </p>
   <pre><strong>输入:</strong> nums = [1,2,3,1], k<em> </em>= 3, t = 0
<strong>输出:</strong> true</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre><strong>输入: </strong>nums = [1,0,1,1], k<em> </em>=<em> </em>1, t = 2
<strong>输出:</strong> true</pre>
   <p>
    <strong>
     示例 3:
    </strong>
   </p>
   <pre><strong>输入: </strong>nums = [1,5,9,1,5,9], k = 2, t = 3
<strong>输出:</strong> false</pre>
  </div>
 </body>
</html>